﻿using System;
using System.Windows.Controls;
using System.Windows;
using WickedFlame.Core.Shapes;
using System.Collections.Generic;


namespace WickedFlame.Util.Controls
{
    public class PropertiesDisplay : ContentControl
    {
        static PropertiesDisplay()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(PropertiesDisplay), new FrameworkPropertyMetadata(typeof(PropertiesDisplay)));
        }

        public PropertiesDisplay()
        {
        }

        List<VectorShape> _shapeList;
        public List<VectorShape> ShapeList
        {
            get
            {
                return _shapeList;
            }
            set
            {
                if (_shapeList != null)
                    UnregisterShape();
                _shapeList = value;
                RegisterShape();
            }
        }

        //VectorShape _shape;
        public VectorShape Shape
        {
            get
            {
                if (ShapeList.Count > 0)
                    return ShapeList[0];

                return null;
            }
            set
            {
                if (ShapeList != null)
                    UnregisterShape();
                ShapeList = new List<VectorShape>();
                ShapeList.Add(value);
                RegisterShape();
            }
        }

        public virtual void UnregisterShape()
        {
        }

        public virtual void RegisterShape()
        {
        }

        
    }
}
